<style tyle="text/css">
	.modal-lg {
		width: 80%;
	}
</style>
<div class="modal-header">
	<h4 class="modal-title">产品信息</h4>
</div>
<div class="modal-body">

	<form name="form" class="form-horizontal form-validation ng-pristine ng-valid ng-valid-required">
		<div class="form-group" ng-show="!is_new">
			<div class="col-lg-3 control-label">产品编号:</div>
			<div class="col-lg-4">
				<input type="text" class="form-control" placeholder="必填" ng-model="obj.code" disabled>
			</div>
		</div>
		<div class="form-group">
			<div class="col-lg-3 control-label">产品名称:</div>
			<div class="col-lg-4">
				<input type="text" class="form-control" placeholder="必填" ng-model="obj.name">
			</div>
		</div>
		<div class="form-group">
			<div class="col-lg-3 control-label">所属景区:</div>
			<div class="col-lg-4">
				<ui-select ng-model="obj.view_code" theme="bootstrap" ng-disabled="!is_new">
					<ui-select-match placeholder="选择所属景区...">{{$select.selected.name}}</ui-select-match>
					<ui-select-choices repeat="item.code as item in viewList">
						<span ng-bind-html="item.name | highlight: $select.search"></span>
					</ui-select-choices>
				</ui-select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-lg-3 control-label">产品类型:</label>
			<div class="col-lg-4">
				<ui-select ng-model="obj.sale_category" theme="bootstrap">
					<ui-select-match placeholder="选择产品类型...">{{$select.selected.name}}</ui-select-match>
					<ui-select-choices repeat="item.code as item in category_list">
						<span ng-bind-html="item.name | highlight: $select.search"></span>
					</ui-select-choices>
				</ui-select>
				<!-- <div class="radio">
					<label class="i-checks">
						<input type="radio" ng-model="obj.sale_category" value="1">
						<i></i>雪具
					</label>
					<label class="i-checks" style="margin-left: 10px">
						<input type="radio" ng-model="obj.sale_category" value="2">
						<i></i>零食
					</label>
				</div> -->
			</div>
		</div>
		<div class="form-group">
			<label class="col-lg-3 control-label">产品分类:</label>
			<div class="col-lg-4">
				<div class="radio">
					<label class="i-checks">
						<input type="radio" ng-model="obj.type" value="1">
						<i></i>消费商品
					</label>
					<label class="i-checks" style="margin-left: 10px">
						<input type="radio" ng-model="obj.type" value="2">
						<i></i>储值产品
					</label>
				</div>
			</div>
		</div>
		<div class="form-group" ng-if="obj.type == '2' && obj.is_define_price == '0'">
			<div class="col-lg-3 control-label">储值金额:</div>
			<div class="col-lg-4">
				<div class="input-group">
					<input type="number" class="form-control" placeholder="0.00" ng-model="obj.recharge">
					<span class="input-group-addon">元</span>
				</div>
			</div>
			<label class="control-label text-muted">
				<!-- <i>总库存为 -1 时,表示无限库存</i> -->
			</label>
		</div>
		<div class="form-group">
			<label class="col-lg-3 control-label">自定义价格:</label>
			<div class="col-lg-2">
				<div class="radio">
					<label class="i-checks">
						<input type="radio" ng-model="obj.is_define_price" value="1">
						<i></i>可以
					</label>
					<label class="i-checks" style="margin-left: 10px">
						<input type="radio" ng-model="obj.is_define_price" value="0">
						<i></i>不可以
					</label>
				</div>
			</div>
			<label class="control-label text-muted">
				<i>是否购买时自定义价格</i>
			</label>
		</div>
		<div class="form-group" ng-show="obj.is_define_price == '0'">
			<div class="col-lg-3 control-label">产品价格:</div>
			<div class="col-lg-4">
				<div class="input-group">
					<input type="number" class="form-control" placeholder="0.00" ng-model="obj.price">
					<span class="input-group-addon">元</span>
				</div>
			</div>
		</div>
		<div class="form-group" ng-show="false">
			<label class="col-lg-3 control-label">支付类型:</label>
			<div class="col-lg-4">
				<div class="radio">
					<label class="i-checks">
						<input type="radio" ng-model="obj.pay_type" value="1">
						<i></i>景区一卡通支付
					</label>
					<label class="i-checks" style="margin-left: 10px">
						<input type="radio" ng-model="obj.pay_type" value="2">
						<i></i>线下支付
					</label>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-lg-3 control-label">是否取商品:</label>
			<div class="col-lg-2">
				<div class="radio">
					<label class="i-checks">
						<input type="radio" ng-model="obj.is_pick" value="1" ng-disabled="obj.type == '2'">
						<i></i>是
					</label>
					<label class="i-checks" style="margin-left: 24px">
						<input type="radio" ng-model="obj.is_pick" value="0" ng-disabled="obj.type == '2'">
						<i></i>否
					</label>
				</div>
			</div>
			<label class="control-label text-muted">
				<i>购买后是否需要领取商品</i>
			</label>
		</div>
		<div class="form-group">
			<label class="col-lg-3 control-label">商品是否归还:</label>
			<div class="col-lg-2">
				<div class="radio">
					<label class="i-checks">
						<input type="radio" ng-model="obj.is_restore" value="1" ng-disabled="obj.type == '2'">
						<i></i>是
					</label>
					<label class="i-checks" style="margin-left: 24px">
						<input type="radio" ng-model="obj.is_restore" value="0" ng-disabled="obj.type == '2'">
						<i></i>否
					</label>
				</div>
			</div>
			<label class="control-label text-muted">
				<i>游客领取的商品是否需要归还</i>
			</label>
		</div>
		<div class="form-group">
			<label class="col-lg-3 control-label">是否可退:</label>
			<div class="col-lg-2">
				<div class="radio">
					<label class="i-checks">
						<input type="radio" ng-model="obj.back_type" value="0">
						<i></i>可退
					</label>
					<label class="i-checks" style="margin-left: 10px">
						<input type="radio" ng-model="obj.back_type" value="1">
						<i></i>不可退
					</label>
				</div>
			</div>
		</div>
		<!-- <div class="form-group">
			<label class="col-lg-3 control-label">是否可作为赠送产品:</label>
			<div class="col-lg-2">
				<div class="radio">
					<label class="i-checks">
						<input type="radio" ng-model="obj.is_gift" value="1" ng-disabled="obj.type == '2'">
						<i></i>可以
					</label>
					<label class="i-checks" style="margin-left: 10px">
						<input type="radio" ng-model="obj.is_gift" value="0" ng-disabled="obj.type == '2'">
						<i></i>不可以
					</label>
				</div>
			</div>
		</div> -->
		<div class="form-group">
			<div class="col-lg-3 control-label">总库存:</div>
			<div class="col-lg-3">
				<div class="input-group">
					<input type="number" class="form-control" ng-model="obj.stock">
					<span class="input-group-addon">张</span>
				</div>
			</div>
			<label class="control-label text-muted">
				<i>总库存为 -1 时,表示无限库存</i>
			</label>
		</div>
		<div class="form-group" ng-if="!is_new">
			<div class="col-lg-3 control-label">剩余库存:</div>
			<div class="col-lg-3">
				<input type="number" class="form-control" ng-model="obj.remaining_stock">
			</div>
			<label class="control-label text-muted">
				<i>剩余库存为 -1 时,表示无限</i>
			</label>
		</div>
		<div class="form-group">
			<div class="col-lg-3 control-label">排序:</div>
			<div class="col-lg-3">
				<input type="number" class="form-control" ng-model="obj.asort">
			</div>
			<label class="control-label text-muted">
				<i>默认为空,自动排序</i>
			</label>
		</div>
		<!-- <div class="form-group">
			<div class="col-lg-3 control-label">附属产品:</div>
			<div class="col-lg-3">
				<ui-select ng-model="searchitem.gift" theme="bootstrap">
					<ui-select-match placeholder="选择附属产品...">{{$select.selected.name}}</ui-select-match>
					<ui-select-choices repeat="item in gift_list">
						<span ng-bind-html="item.name | highlight: $select.search"></span>
					</ui-select-choices>
				</ui-select>
			</div>
			<div class="col-lg-2">
				<input type="number" class="form-control" ng-model="searchitem.num" placeholder="数量" value="1">
			</div>
			<label class="col-lg-1">
				<button class="btn btn-success" type="button" ng-click="add()">添加</button>
			</label>
		</div> -->
		<div class="form-group">
			<div class="col-lg-3"></div>
			<div class="col-lg-8">
				<div style="padding-right: 5px; padding-bottom: 5px; float: left;" ng-repeat="info in gifts">
					<button class="btn btn-sm btn-info">{{info.name}}&nbsp;&nbsp;&nbsp;&nbsp;
						<i class="glyphicon glyphicon-remove" ng-click="remove($index)"></i>
					</button>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-lg-3 control-label">产品简介:</label>
			<div class="col-lg-6">
				<textarea class="form-control" placeholder="产品描述信息" rows="3" ng-model="obj.detail"></textarea>
			</div>
		</div>
		<div class="form-group">
			<label class="col-lg-3 control-label">宣传图:</label>
			<div class="col-lg-6">
				<img ng-src="{{obj.img}}" width="300" height="200" ng-model="obj.img">
				<input type="file" nv-file-select uploader="uploader" />
				<br>
				<ul class="list-group">
					<li class="list-group-item" ng-repeat="item in uploader.queue">
						文件名:
						<span ng-bind="item.file.name"></span>
						<button type="button" class="btn btn-default btn-xs" ng-click="item.upload()">
							<span class="glyphicon glyphicon-upload"></span> 上传</button>
						<div class="progress mt10">
							<div class="progress-bar" role="progressbar" ng-style="{ 'width': uploader.progress + '%' }"></div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>

<div class="modal-footer">
	<button class="btn btn-success" type="button" ng-click="ok()">确定</button>
	<button class="btn btn-danger" type="button" ng-click="close()">关闭</button>
</div>